
    <?php if ($current_customer['group_id'] == '1'): ?>
        <div class="admin_left actions">
        <h3 style="font-size:20px;">Manage more</h3>

            <ul>
                <li style="list-style-type:none; margin-bottom:20%;"><?php echo $this->Html->link(__('List Items'), array('action' => 'index'),array('class' => 'consistentButton')); ?> </li>
                <li style="list-style-type:none; margin-bottom:20%;"><?php echo $this->Html->link(__('List Customers'), array('action' => 'index'),array('class' => 'consistentButton')); ?></li>
                <li style="list-style-type:none; margin-bottom:20%;"><?php echo $this->Html->link(__('List Markdowns'), array('controller' => 'markdowns', 'action' => 'index'),array('class' => 'consistentButton')); ?> </li>
                <li style="list-style-type:none; margin-bottom:20%;"><?php echo $this->Html->link(__('New Image'), array('controller' => 'images', 'action' => 'add'),array('class' => 'consistentButton')); ?> </li>
                <li style="list-style-type:none; margin-bottom:20%;"><?php echo $this->Html->link(__('Edit Item'), array('action' => 'edit', $item['Item']['id']),array('class' => 'consistentButton')); ?> </li>
                <li style="list-style-type:none; margin-bottom:20%;"><?php echo $this->Form->postLink(__('Delete Item'), array('action' => 'delete', $item['Item']['id']),array('class' => 'consistentButton'), null, __('Are you sure you want to delete # %s?', $item['Item']['id'])); ?> </li>
            </ul>
        </div>
    <?php endif ?>


    <?php if ($current_customer['group_id'] == '1'): ?>
        <div class="admin_right items view">


            <div id="breadcrumbAdmin" class = "breadcrumb">
                   <?php $this->Html->addCrumb('View item', '/Items/view', array('style'=> ('text-decoration:underline; color:#EB1E70;'))); ?>
                   <?php echo $this->Html->getCrumbs(' > ', array( 'text' => 'Items', 'url' => array('controller' => 'items', 'action' => 'index'), 'escape' => false)); ?>
            </div>


            <h2><?php  echo __('Item'); ?></h2>
            <table class="table table-striped table-bordered" class="table table-striped table-bordered">
                <tr>
                    <th><?php echo __('Id'); ?></th>
                    <th><?php echo __('Name'); ?></th>
                    <th><?php echo __('Brand'); ?></th>

                    <th><?php echo __('Category'); ?></th>

                    <th><?php echo __('Location'); ?></th>
                    <th><?php echo __('Original Price'); ?></th>
                    <th>Preview</th>

                </tr>

                <tr>

                    <td>
                        <?php echo h($item['Item']['id']); ?>
                        &nbsp;
                    </td>

                    <td>
                        <?php echo h($item['Item']['name']); ?>
                        &nbsp;
                    </td>

                    <td>
                        <?php echo h($item['Brand']['name']); ?>
                        &nbsp;
                    </td>


                    <td>
                        <?php echo h($item['Category']['name']); ?>
                        &nbsp;
                    </td>



                    <td>
                        <?php echo h($item['Item']['location']); ?>
                        &nbsp;
                    </td>

                    <td>
                        <?php echo h($item['Item']['original_price']); ?>
                        &nbsp;
                    </td>

                  

                    <br>
                    <td>
                        <?php if (!empty($item['Image'])): ?>
                            <table cellpadding = "0" cellspacing = "0" class="table table-striped table-bordered">
                                <tr>
                                    <?php $inRow = 0; ?>
                                    <?php $i = 0; ?>
                                    <?php foreach ($item['Image'] as $image): ?>
                                    <td>
                                        <?php
                                            echo $this->Html->image('IMG_DIR'.'/'.$image['name'], array('width' => 175, 'height' => 175));
                                        ?>&nbsp;
                                        <br>
                                        <?php echo h($image['id']); ?>
                                        <br>
                                        <?php if ($current_customer['group_id'] == 1): ?>
                                            <?php echo $this->Html->link(__('View'), array('controller' => 'images', 'action' => 'view', $image['id'])); ?>
                                            <?php echo $this->Html->link(__('Edit'), array('controller' => 'images', 'action' => 'edit', $image['id'])); ?>
                                            <?php echo $this->Form->postLink(__('Delete'), array('controller' => 'images', 'action' => 'delete', $image['id']), null, __('Are you sure you want to delete # %s?', $image['id'])); ?>
                                        <?php endif; ?>
                                    </td>
                                <?php
                                    $inRow++;
                                    if ($inRow % 3 == 0) {
                                        echo "</tr>";
                                    }
                                endforeach; ?>
                            </table>
                        <?php else: ?>
                            <?php echo "No images available"; ?>
                        <?php endif; ?>
                    </td>
                </tr>
            </table>



            <?php if ($current_customer['group_id'] == 1): ?>

                <div class="related">
                <h3>Related photos</h3>
                    <?php if (!empty($item['Image'])): ?>
                        <table cellpadding = "0" cellspacing = "0" class="table table-striped table-bordered">
                            <tr>
                                <th><?php echo __('Id'); ?></th>
                                <th><?php echo __('Name'); ?></th>
                                <th><?php echo __('Item Id'); ?></th>
                                <th class="actions"><?php echo __('Actions'); ?></th>
                            </tr>
                            <?php
                                $i = 0;
                                foreach ($item['Image'] as $image): ?>
                                    <tr>
                                        <td><?php echo $image['id']; ?></td>
                                        <td><?php echo $image['name']; ?></td>
                                        <td><?php echo $image['item_id']; ?></td>
                                        <td class="actions">
                                            <?php echo $this->Html->link(__('View'), array('controller' => 'images', 'action' => 'view', $image['id'])); ?>
                                            <?php echo $this->Html->link(__('Edit'), array('controller' => 'images', 'action' => 'edit', $image['id'])); ?>
                                            <?php echo $this->Form->postLink(__('Delete'), array('controller' => 'images', 'action' => 'delete', $image['id']), null, __('Are you sure you want to delete # %s?', $image['id'])); ?>
                                        </td>
                                    </tr>
                            <?php endforeach; ?>
                        </table>
                    <?php endif; ?>
                </div>
            <?php endif; ?>
        </div>
    <?php else: ?>
        <div id="publicItemView1">
            <div id="breadcrumbAdmin" class = "breadcrumb">
                   <?php $this->Html->addCrumb('View item', '/Items/view', array('style'=> ('text-decoration:underline; color:#EB1E70;'))); ?>
                   <?php echo $this->Html->getCrumbs(' > ', array( 'text' => 'Home', 'url' => array('controller' => 'Pages', 'action' => 'pagehome'), 'escape' => false)); ?>
            </div>

            <div id="publicItemViewLeft">
                        <ul class="bxslider">
                        <?php
                            foreach($images[0]['Image'] as $image)
                                echo "<li>" . $this->Html->image(IMG_DIR.'/'.$image['name'], array('class' => 'product-image-bxslider')) . "</li>";
                        ?>
                        </ul>
                        <div id="bx-pager">
                        <?php $counter = 0; ?>
                        <?php foreach($images[0]['Image'] as $image): ?>
                            <a data-slide-index="<?php echo $counter++; ?>" href=""><img class="product-icon-bxslider" src="/CakePHP/img/<?php echo IMG_DIR.'/'.$image['name']; ?>" /></a>
                        <?php endforeach; ?>
                        </div>
                        <script>
                            $(document).ready(function(){
                                $('.bxslider').bxSlider({
                                    pagerCustom: '#bx-pager'
                                });
                            });
                        </script>
                        <?php //echo $this->Html->image(IMG_DIR.'/'.$item['Item']['photo'], array('title' => $item['Item']['photo'],'alt'=>$item['Item']['name'], 'height'=>600)); ?>
            </div>

            <div id="publicItemViewRight">
                <h2><?php echo h($item['Item']['name']); ?></h2>
                <h3><?php echo __('      $');
                 echo h($item['Item']['original_price']);
                  echo __('   AUD'); ?></h3>
                <div id="publicItemDescription">
                    <p style="font-size:1.2em; padding-top:10px; padding-bottom:10px;"><?php echo h($item['Item']['description']); ?></p>


                    <table style="font-size:1.2em; width:40%;  margin-bottom:3%;" class="table">
                        <tr style="">
                            <th><?php echo __('Brand:'); ?></th>
                             <td>
                                <?php echo h($item['Brand']['name']); ?>
                                &nbsp;
                             </td>
                        </tr>

                        <tr>
                            <th><?php echo __('Color:'); ?></th>
                            <td>
                                <?php echo h($item['Color']['name']); ?>
                                &nbsp;
                            </td>
                        </tr>

                        <tr>
                            <th><?php echo __('Category:'); ?></th>
                            <td>
                                <?php echo h($item['Category']['name']); ?>
                                &nbsp;
                            </td>
                        </tr>

                        <tr>
                            <th><?php echo __('Condition:'); ?></th>
                            <td>
                               <?php echo h($item['Condition']['name']); ?>
                                &nbsp;
                            </td>
                        </tr>

                        <tr>
                            <th><?php echo __('Size:'); ?></th>
                            <td>
                                <?php echo h($item['Size']['name']); ?>
                                &nbsp;
                            </td>
                        </tr>
                    </table>

                    <p style="text-align:right;border-top:2px solid #000000;">&nbsp;</p>

                    <div class="actions" id="addToCartButton">
                        <!--<?php echo $this->Html->link(__('Add to Cart'), array('controller' => 'Carts', 'action' => 'addItemToCart', $item['Item']['id']), array('style'=>'width:200px;')); ?>-->

                    </div>

                    <?php echo $this->Form->create(NULL, array('url' => array('controller' => 'shop', 'action' => 'add')));
                          echo $this->Form->input('id', array('type' => 'hidden', 'value' => $item['Item']['id']));
                          echo $this->Form->input('quantity', array('type' => 'hidden', 'value' => 1));
                          echo $this->Form->button('<i class="icon-heart icon-white"></i> Add to Bag', array('class' => 'btn btn-info btn-large addtocart', 'id' => $item['Item']['id'], 'escape' => false));
                          echo $this->Form->end();
                    ?>



                </div>
            </div>
        </div>
    <?php endif; ?>